package com.zfl.practice;

import java.util.ArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class SynchronizedDemo {

    public static void main(String[] args) {
//        BankAccount zfl = new BankAccount("zfl", new ArrayList<>());
//        ExecutorService pool = Executors.newFixedThreadPool(10);
//        for (int i = 0; i < 200; i++) {
//            final int finalI = i;
//            pool.execute(()->{
//                zfl.add(finalI);
//            });
//        }
//        pool.shutdown();
//        System.out.println("zfl = " + zfl);
//        System.out.println("zfl.getBalance().size() = " + zfl.getBalance().size());
    }
}
